package org.walkerljl.commons.schedule.defaults;

import org.walkerljl.commons.schedule.Job;
import org.walkerljl.commons.schedule.JobExecutionContext;
import org.walkerljl.commons.schedule.JobExecutionException;
import org.walkerljl.commons.schedule.RunnableJob;

/**
 * @author lijunlin
 */
class DefaultRunnableJob implements RunnableJob {

    private JobExecutionContext jobContext;

    private Job job;

    public DefaultRunnableJob(Job job, JobExecutionContext jobContext) {
        this.job = job;
        this.jobContext = jobContext;
    }

    @Override
    public void run() {
        execute(jobContext);
    }

    @Override
    public String getId() {
        return null;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public String getGroup() {
        return null;
    }

    @Override
    public void execute(JobExecutionContext jobContext) throws JobExecutionException {
        job.execute(jobContext);
    }
}
